package com.hzy.alibaba.dao.impl;

import com.hzy.alibaba.dao.GeneratorDao;
import com.hzy.alibaba.entity.Column;
import com.hzy.alibaba.entity.Table;
import com.hzy.alibaba.mapper.GeneratorMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class GeneratorDaoImpl implements GeneratorDao {
    @Resource
    private GeneratorMapper databasesMapper;

    @Override
    public List<Table> getTables(String database) {
        return databasesMapper.selectTable(database);
    }

    @Override
    public List<Column> getColumns(String database, String tableName) {
        return databasesMapper.selectColumn(database,tableName);
    }
}
